export const treeToArr = (obj) => {
  let arr = [];
  for (let i in obj) {
    if (obj[i].children) {
      arr = arr.concat(treeToArr(obj[i].children));
      delete obj[i].children;
      arr.push(obj[i]);
    } else {
      arr.push(obj[i]);
    }
  }
  return arr;
};
